package org.apix.commands.command;

import org.apix.Apix;
import org.apix.commands.BaseCommand;
import org.apix.configuration.PlayerStorageData;
import org.bukkit.entity.Player;

public class Home extends BaseCommand {

	@Override
	public boolean execute(Player p, org.bukkit.command.Command command, String[] args){
		Apix.log.info(p.getName());
		if(!isEnabled()) {
			return false;
		}
		
		if(!this.defaultCommandChecks(p)) {
			return true;
		}
		
		Apix.log.info("Attempting to send player "+ p.getName() +" to home.");
		p.teleport(PlayerStorageData.getInstance(p).getHome());
		
		return true;
	}
}
